/**
 * @File   : Routers.js
 * @Author : xue.xiaoBing
 * @Date   : 2021/04/12
 * @Desc   : 项目路由总览
 **/

import React from "react";
import {Route, Switch, Redirect} from "react-router-dom";

import NoFound from "src/components/errorPages/noFound/NoFound";

import Admin from "src/containers/admin";
import Login from "src/containers/login";
import Teacher from "src/containers/teach";
import Home from "src/containers/home/Home";
import Live from "src/containers/live/Live";
import Exam from "src/containers/exam/Exam";
import Video from "src/containers/video/Video";
import ExamInfo from "src/containers/exam/examInfo/ExamInfo";
import StartExam from "src/containers/exam/startExam/StartExam";
import ManageExam from "src/containers/exam/manageExam/ManageExam";
// import StayTuned from "./components/stayTuned";


export default class Routers extends React.Component {
  render() {
    return (
      <Switch>
        {/**首页**/}
        <Route exact path={'/'} component={Home}/>
        {/**登录**/}
        <Route exact path={'/login'} component={Login}/>
        {/**直播**/}
        <Route exact path={'/live'} component={Live}/>
        {/**考试**/}
        <Route exact path={'/exam'} component={Exam}/>
        {/**视频**/}
        <Route exact path={'/video'} component={Video}/>
        {/** 教师 **/}
        <Route exact path={'/teach'} component={Teacher}/>
        {/** 管理员 **/}
        <Route exact path={'/admin'} component={Admin}/>

        <Route exact path={'/exam/:auth_id/:exam_id'} component={ExamInfo}/>
        <Route exact path={'/exam/manageExam/:auth_id/:exam_id'} component={ManageExam}/>
        <Route exact path={'/exam/startExam/:auth_id/:exam_id'} component={StartExam}/>

        <Redirect exact to={'/home'} from={'/'}/>

        {/** 错误跳转 **/}
        <Route render={() => <NoFound/>}/>
      </Switch>
    )
  }
}